package com.nycreativity.elecreativity.entity.vo.shoppingcart

import com.nycreativity.elecreativity.entity.dto.SkuSpecificationDTO
import com.nycreativity.elecreativity.times
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import java.math.BigDecimal

/**
 * @description 购物车item信息
 * @author sxt
 * @date 2021/4/19 11:20 上午
 * @version 1.0
 */
@ApiModel("购物车item信息")
class ShoppingCartItemVO(

    /**
     * 商品id
     */
    @ApiModelProperty("商品id")
    var goodsId: Long? = null,

    /**
     * 商品skuId
     */
    @ApiModelProperty("商品skuId")
    var skuId: Long? = null,

    /**
     * 商品数量
     */
    @ApiModelProperty("商品数量")
    var count: Int = 0,

    /**
     * 商品单价
     */
    @ApiModelProperty("商品单价")
    var price: BigDecimal = BigDecimal(0),

    /**
     * 商品名称
     */
    @ApiModelProperty("商品名称")
    var goodsName: String? = null,

    /**
     * 多张图片逗号分隔
     */
    @ApiModelProperty("多张图片逗号分隔")
    var images: String? = null,

    /**
     * 商品具体规格
     */
    @ApiModelProperty("商品具体规格，当cjs不明白传什么的时候请速速联系我")
    var specification: SkuSpecificationDTO? = null,

    ) {
    /**
     * 总金额
     */
    var allAmount: BigDecimal = BigDecimal(0)
        private set
        get() = price * count
}